﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum E_DO_tpye
{
    changeName,
    setActive,
    destroy,
    destroyImmediumly
}
public class Lesson4_A : MonoBehaviour
{
    public GameObject b;
    public E_DO_tpye tpye = E_DO_tpye.changeName;
    // Start is called before the first frame update
    void Start()
    {
        switch (tpye)
        {
            case E_DO_tpye.changeName:
                b.name = "B改";
                break;
            case E_DO_tpye.setActive:
                b.SetActive(false);
                break;
            case E_DO_tpye.destroy:
                Destroy(b,5f);
                break;
            case E_DO_tpye.destroyImmediumly:
                DestroyImmediate(b);
                break;
            default:
                break;
        }
    }

}
